package com.cooge.jiexi;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;


public class SohuOver {

	public static void main(String[] args) throws Exception {
		String link = "http://tv.sohu.com/20140812/n403373476.shtml";
		String html = NetUtil.getHtml(link);
		int start = html.indexOf("var vid=")+"var vid=".length();
		int end = html.indexOf(";", start);
		String vid  = html.substring(start, end).replaceAll("[^0-9]", "");
		String url = "http://hot.vrs.sohu.com/vrs_flash.action?vid="+vid;
		String jString = NetUtil.getHtml(url);
		JSONObject json  =  JSON.parseObject(jString);
		String id = json.getString("id");
		if(id==null){
			System.out.println("下线");
		}
		JSONObject data = json.getJSONObject("data");
		if(data==null){
			System.out.println("下线");
		}
		

	}

}
